package cn.njxzc.exercises;

import java.io.*;
public class RedirectDemo {
	public static void main(String[] args) throws IOException {
		FileOutputStream fos = new FileOutputStream("out.txt");
		BufferedOutputStream bos = new BufferedOutputStream(fos, 1024);
		PrintStream ps = new PrintStream(bos, false);
		System.setOut(ps);
		System.out.println("This is a test\u4321");
		int n = 37;
		System.out.println("The square of " + n + " is " + (n * n));
		ps.close();
	}

}
